######################Simulations for posterior predictive p-values#############
###########weak null + regular DGP + unstudentized test statistcs###############


###############################load packages####################################
# if(!require(MCMCpack)) install.packages(MCMCpack)
# if(!require(parallel)) install.packages(parallel)
# if(!require(tidyverse)) install.packages(tidyverse)
# if(!require(Matching)) install.packages(Matching)
# if(!require(latex2exp)) install.packages(latex2exp)
library(MCMCpack)
library(parallel)
library(tidyverse)
library(Matching)
library(latex2exp)


#######You can set the nNodes according to the number of cores of the CPU#######
#nNodes <- detectCores() - 2
nNodes <- 4


################################ load functions ################################
#####Put the 5 files into a same folder and set it as the working directory#####
#setwd("~/PPPPP")
source("Main Function.R",local = T)
source("estimating.R",local = TRUE)
source("testing.R",local = TRUE)
source("dta_generating.R",local = TRUE)
source("data processing.R",local = T)


#################################set the parameter##############################
params$data <- 'regular'
params$is.indiv <- F
params$normalize <- F
params$beta.logis <- -params$beta.logis


ppp <- para.cal(simu.test,10,NA,seed)
dta_plot(ppp)
#save.image("ppp weak null unstu.RData")

